HA$PBExportHeader$w_arg_rep_osac_grafico_tecnico.srw
forward
global type w_arg_rep_osac_grafico_tecnico from w_arg_report
end type
type st_1 from statictext within w_arg_rep_osac_grafico_tecnico
end type
type dp_fini from datepicker within w_arg_rep_osac_grafico_tecnico
end type
type st_3 from statictext within w_arg_rep_osac_grafico_tecnico
end type
type st_4 from statictext within w_arg_rep_osac_grafico_tecnico
end type
type dp_ffin from datepicker within w_arg_rep_osac_grafico_tecnico
end type
type ddlb_tecnico from uo_middlb within w_arg_rep_osac_grafico_tecnico
end type
type ddlb_area from uo_middlb within w_arg_rep_osac_grafico_tecnico
end type
type st_5 from statictext within w_arg_rep_osac_grafico_tecnico
end type
type rb_1 from radiobutton within w_arg_rep_osac_grafico_tecnico
end type
type rb_2 from radiobutton within w_arg_rep_osac_grafico_tecnico
end type
type rb_3 from radiobutton within w_arg_rep_osac_grafico_tecnico
end type
end forward

global type w_arg_rep_osac_grafico_tecnico from w_arg_report
integer width = 2039
integer height = 828
string title = "Reportes de Solicitudes"
st_1 st_1
dp_fini dp_fini
st_3 st_3
st_4 st_4
dp_ffin dp_ffin
ddlb_tecnico ddlb_tecnico
ddlb_area ddlb_area
st_5 st_5
rb_1 rb_1
rb_2 rb_2
rb_3 rb_3
end type
global w_arg_rep_osac_grafico_tecnico w_arg_rep_osac_grafico_tecnico

type variables
string isa_alma[],is_alma,isa_item[],is_item,isa_trans[] ,is_trans,isa_area[],isa_gere[],is_area,is_gere,is_tipo,is_tecnico,isa_tecnico[]

end variables

forward prototypes
public subroutine wf_ejecutar_reporte ()
end prototypes

public subroutine wf_ejecutar_reporte ();Datetime ldt_fecini,ldt_fecfin
string ls_titulo_fecha
ldt_fecini =datetime(date(dp_fini.text),time('00:00:00'))
ldt_fecfin = datetime(date(dp_ffin.text),time('23:59:59'))
//istr_parm.dw_parm[1].Retrieve(istr_parm.integer_parm[1],istr_parm.integer_parm[2],integer(is_trans),ldt_fecini,ldt_fecfin)
ls_titulo_fecha = 'DESDE ' + STRING(ldt_fecini,'DD/MM/YYYY') + ' AL ' + STRING(ldt_fecfin,'DD/MM/YYYY HH:MM:SS')

choose case is_tipo 
	case 'E'
		istr_parm.dw_parm[1].dataobject = 'd_rep_estadistico_soli_efectivas_gr'
	case 'N'
		istr_parm.dw_parm[1].dataobject = 'd_rep_estadistico_soli_noconforme_gr'
	case 'P'
		istr_parm.dw_parm[1].dataobject = 'd_rep_estadistico_soli_proceso_gr'
end choose
istr_parm.dw_parm[1].settransobject(sqlca)
istr_parm.dw_parm[1].Retrieve(is_tecnico,ldt_fecini,ldt_fecfin,is_tipo)
if isnull(ls_titulo_fecha) then ls_titulo_fecha = ''
istr_parm.dw_parm[1].object.t_titulo.text =ls_titulo_fecha

//istr_parm.dw_parm[1].object.t_titulo2.text ='GERENCIA :' + UPPER(ddlb_gere.TEXT)
//
//cb_2.triggerevent( clicked!)
end subroutine

on w_arg_rep_osac_grafico_tecnico.create
int iCurrent
call super::create
this.st_1=create st_1
this.dp_fini=create dp_fini
this.st_3=create st_3
this.st_4=create st_4
this.dp_ffin=create dp_ffin
this.ddlb_tecnico=create ddlb_tecnico
this.ddlb_area=create ddlb_area
this.st_5=create st_5
this.rb_1=create rb_1
this.rb_2=create rb_2
this.rb_3=create rb_3
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.st_1
this.Control[iCurrent+2]=this.dp_fini
this.Control[iCurrent+3]=this.st_3
this.Control[iCurrent+4]=this.st_4
this.Control[iCurrent+5]=this.dp_ffin
this.Control[iCurrent+6]=this.ddlb_tecnico
this.Control[iCurrent+7]=this.ddlb_area
this.Control[iCurrent+8]=this.st_5
this.Control[iCurrent+9]=this.rb_1
this.Control[iCurrent+10]=this.rb_2
this.Control[iCurrent+11]=this.rb_3
end on

on w_arg_rep_osac_grafico_tecnico.destroy
call super::destroy
destroy(this.st_1)
destroy(this.dp_fini)
destroy(this.st_3)
destroy(this.st_4)
destroy(this.dp_ffin)
destroy(this.ddlb_tecnico)
destroy(this.ddlb_area)
destroy(this.st_5)
destroy(this.rb_1)
destroy(this.rb_2)
destroy(this.rb_3)
end on

event open;call super::open;istr_parm.integer_parm[1]=0
istr_parm.integer_parm[2]=0

ddlb_tecnico.selectitem( 1)
//ddlb_area.selectitem( 1)

is_tipo = 'E'
end event

type cb_2 from w_arg_report`cb_2 within w_arg_rep_osac_grafico_tecnico
integer x = 1586
integer y = 580
end type

type cb_1 from w_arg_report`cb_1 within w_arg_rep_osac_grafico_tecnico
integer x = 1138
integer y = 580
boolean default = true
end type

type dw_1 from w_arg_report`dw_1 within w_arg_rep_osac_grafico_tecnico
boolean visible = false
integer x = 128
integer y = 844
integer width = 407
integer height = 112
end type

type st_1 from statictext within w_arg_rep_osac_grafico_tecnico
integer x = 37
integer y = 28
integer width = 329
integer height = 72
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "T$$HEX1$$e900$$ENDHEX$$cnico:"
boolean focusrectangle = false
end type

type dp_fini from datepicker within w_arg_rep_osac_grafico_tecnico
integer x = 466
integer y = 152
integer width = 603
integer height = 84
integer taborder = 50
boolean bringtotop = true
boolean border = true
borderstyle borderstyle = stylelowered!
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2010-11-10"), Time("17:05:10.000000"))
integer textsize = -8
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

type st_3 from statictext within w_arg_rep_osac_grafico_tecnico
integer x = 55
integer y = 164
integer width = 379
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Fecha Inicial:"
boolean focusrectangle = false
end type

type st_4 from statictext within w_arg_rep_osac_grafico_tecnico
integer x = 55
integer y = 284
integer width = 334
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Fecha Final:"
boolean focusrectangle = false
end type

type dp_ffin from datepicker within w_arg_rep_osac_grafico_tecnico
integer x = 466
integer y = 276
integer width = 594
integer height = 80
integer taborder = 40
boolean bringtotop = true
boolean border = true
borderstyle borderstyle = stylelowered!
datetimeformat format = dtfcustom!
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2010-11-10"), Time("17:05:10.000000"))
integer textsize = -8
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

type ddlb_tecnico from uo_middlb within w_arg_rep_osac_grafico_tecnico
integer x = 462
integer y = 20
integer width = 1097
boolean bringtotop = true
end type

event constructor;call super::constructor;this.event ue_rellena('select idUser,tNomb from muser where idArea = 1 and bStat = 1 order by 2 asc')
end event

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[1]=integer(isa_gere[index] )

//ddlb_item.reset( )
//ddlb_item.event ue_rellena('select distinct a.iditem,i.tDescCorta from mitem i , mitemalma a where i.iditem = a.iditem and  a.idalma = case "'+string(istr_parm.integer_parm[1])+'" when 0 then a.idalma else   "'+string(istr_parm.integer_parm[1])+'"  end order by 2 asc')
end event

event ue_rellena;long ll_indice= 1

setpointer(hourglass!)
isa_tecnico[ll_indice]=''
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++

prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_tecnico[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_tecnico[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)




end event

type ddlb_area from uo_middlb within w_arg_rep_osac_grafico_tecnico
boolean visible = false
integer x = 800
integer y = 772
integer width = 1097
integer taborder = 20
boolean bringtotop = true
end type

event selectionchanged;call super::selectionchanged;istr_parm.integer_parm[2]=integer(isa_area[index] )
end event

event ue_rellena;


long ll_indice= 1

setpointer(hourglass!)
isa_area[ll_indice]=STRING(0)
is_columna2[ll_indice]='TODOS()'
this.additem(is_columna2[ll_indice])
ll_indice ++

prepare sqlsa from :as_cadena;
declare cur01 dynamic cursor for sqlsa;
open dynamic cur01 ;
fetch cur01 into :isa_area[ll_indice], :is_columna2[ll_indice];
do while sqlca.sqlcode=0 
	this.additem(is_columna2[ll_indice])
	ll_indice++
	fetch cur01 into :isa_area[ll_indice], :is_columna2[ll_indice];
loop
if sqlca.sqlcode = -1 then
   return -1
else
	close cur01 ;
	return 1
end if
setpointer(arrow!)




end event

event constructor;call super::constructor;//this.event ue_rellena('select idarea,tdesc from marea where idarea <> 0 order by 1 asc')
end event

type st_5 from statictext within w_arg_rep_osac_grafico_tecnico
boolean visible = false
integer x = 448
integer y = 756
integer width = 352
integer height = 88
boolean bringtotop = true
integer textsize = -8
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Area:"
boolean focusrectangle = false
end type

type rb_1 from radiobutton within w_arg_rep_osac_grafico_tecnico
integer x = 41
integer y = 400
integer width = 1038
integer height = 72
boolean bringtotop = true
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "Solicitudes efectivas x t$$HEX1$$e900$$ENDHEX$$cnico"
boolean checked = true
end type

event clicked;is_tipo = 'E'
end event

type rb_2 from radiobutton within w_arg_rep_osac_grafico_tecnico
integer x = 37
integer y = 480
integer width = 1029
integer height = 72
boolean bringtotop = true
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "Solicitudes No Conforme por T$$HEX1$$e900$$ENDHEX$$cnico"
end type

event clicked;is_tipo = 'N'
end event

type rb_3 from radiobutton within w_arg_rep_osac_grafico_tecnico
integer x = 37
integer y = 556
integer width = 1015
integer height = 72
boolean bringtotop = true
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
string text = "Solicitudes en Proceso por T$$HEX1$$e900$$ENDHEX$$cnico"
end type

event clicked;is_tipo = 'P'
end event

